<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('wechat_messages', function (Blueprint $table) {
            $table->id();
            $table->string('key')->comment('消息关键词');
            $table->string('msg_type')->comment('消息类型');
            $table->string('content')->nullable()->comment('消息内容');
            // 扩展字段
            $table->json('extra_json')->nullable()->comment('扩展字段');
            $table->tinyInteger('status')->default(1)->comment('状态:  1:正常  2: 禁用');
            $table->integer('sort')->default(50)->comment('排序');
            $table->timestamps();
            $table->comment('消息自动回复表');
        });

    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('wechat_messages');
    }
};
